<title>Brian's Page</title>
<ol>
<li>Daily Recap of Transactions with Total Summary</li>
<li>Total Cash, checks, credit, gift card, change, voids.. Also will need to see list of payments with payment data all on one sheet. This report will load inside an iframe with a pdf print icon so that each report opens in a new window for printing.</li>
<li>The others are pretty simple. Please comment as much as you can in the code.</li>
<li>The receipt tables include:</li>
<li>Tblorders and tbltransactions</li>
<li>All payment data is located in the tblpayments table. Also for the daily recap there is a table called tblcash, this is used to enter the amount of cash that the casher starts with. This will need to be calculated on the daily recap. Let me know if this makes sense. Please provide an estimate of hours you will need to complete these  3 reports.</li>
</ol>
<cfset this_table = "tblpayments">
<cfquery datasource="#dsn1#" name="tblpayments_data">
	select * from #this_table#
</cfquery>
<cfoutput>
	<h1></h1>
	<table width="100%" border="1">
		<tr bgcolor="##F0F0F0">
			<td colspan="#Incrementvalue(ListLen(tblpayments_data.columnlist))#" align="center">#this_table#: (#tblpayments_data.recordcount# records)</td>
		</tr>
		<tr>
			<td align="center" style="font-size:8pt;">##</td>
			<cfloop list="#tblpayments_data.columnlist#" index="this_col">
				<td align="center" style="font-size:8pt;">
					#this_col#
				</td>
			</cfloop>
		</tr>
		<cfloop query="tblpayments_data">
			<tr>
				<td align="center" style="font-size:8pt;">#currentrow#</td>
				<cfloop list="#tblpayments_data.columnlist#" index="this_col">
					<td align="center" style="font-size:8pt;">
						#evaluate(this_col)#
					</td>
				</cfloop>
			</tr>
		</cfloop>
	</table>
	
	<h1>By Date Using TRANSDATE:</h1>
	<cfquery datasource="#dsn1#" name="tblpayments_data_date">
		select TRANSDATE, 
		count(TRANSDATE) as total_count,
		SUM(AMOUNT) as total_amt
		from #this_table#
		group by TRANSDATE
		order by TRANSDATE
	</cfquery>
	<cfset this_total = 0>
	<table border="1">
		<cfloop query="tblpayments_data_date">
			<tr>
				<td>#DateFormat(TRANSDATE, "yyyy-mm-dd")#</td>
				<td>#total_count#</td>
				<td>#NumberFormat(total_amt,"$0.00")#</td>
				<cfset this_total = this_total+total_amt>
			</tr>
		</cfloop>
			<tr>
				<td colspan="2">TOTAL</td>
				<td>#NumberFormat(this_total,"$0.00")#</td>
			</tr>
	</table>
	
<cfset this_table = "tbltransactions">
<cfquery datasource="#dsn1#" name="this_table_data">
	select * from #this_table#
</cfquery>
	<h1></h1>
	<table width="100%" border="1">
		<tr bgcolor="##F0F0F0">
			<td colspan="#Incrementvalue(ListLen(this_table_data.columnlist))#" align="center">#this_table#: (#this_table_data.recordcount# records)</td>
		</tr>
		<tr>
			<td align="center" style="font-size:8pt;">##</td>
			<cfloop list="#this_table_data.columnlist#" index="this_col">
				<td align="center" style="font-size:8pt;">
					#this_col#
				</td>
			</cfloop>
		</tr>
		<cfloop query="this_table_data">
			<tr>
				<td align="center" style="font-size:8pt;">#currentrow#</td>
				<cfloop list="#this_table_data.columnlist#" index="this_col">
					<td align="center" style="font-size:8pt;">
						#evaluate(this_col)#
					</td>
				</cfloop>
			</tr>
		</cfloop>
	</table>

<cfset this_table = "Tblorders">
<cfquery datasource="#dsn1#" name="this_table_data">
	select * from #this_table#
</cfquery>
	<h1></h1>
	<table width="100%" border="1">
		<tr bgcolor="##F0F0F0">
			<td colspan="#Incrementvalue(ListLen(this_table_data.columnlist))#" align="center">#this_table#: (#this_table_data.recordcount# records)</td>
		</tr>
		<tr>
			<td align="center" style="font-size:8pt;">##</td>
			<cfloop list="#this_table_data.columnlist#" index="this_col">
				<td align="center" style="font-size:8pt;">
					#this_col#
				</td>
			</cfloop>
		</tr>
		<cfloop query="this_table_data">
			<tr>
				<td align="center" style="font-size:8pt;">#currentrow#</td>
				<cfloop list="#this_table_data.columnlist#" index="this_col">
					<td align="center" style="font-size:8pt;">
						#evaluate(this_col)#
					</td>
				</cfloop>
			</tr>
		</cfloop>
	</table>
	
	
</cfoutput>

